﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ERPEF.Model
{
    //仓库盘点
    public class inv_WarehouseInven
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int iwi_id { get; set; }
        public string iwi_code { get; set; } //盘点单号
        public string? iwi_W_Name { get; set; } //盘点仓库
        public DateTime? iwi_date { get; set; } //盘点日期
        public string? iwi_checker { get; set; } //盘点人
        public string? iwi_auditor { get; set; } //审核人
        public DateTime? iwi_auditTime { get; set; } //审核时间
        public bool?  iwi_AuditStatus{ get; set; } //审核状态
        public bool IsDeleted { get; set; } = false; // 逻辑删除字段

        public List<inv_WarehouseInven_C> inv_WarehouseInven_C { get; set; }
        public virtual string ToString()
        {
            if (inv_WarehouseInven_C != null && inv_WarehouseInven_C.Count > 0)
            {
                return inv_WarehouseInven_C.Count + " - " + inv_WarehouseInven_C[0].igi_name;
            }
            else
            {
                return base.ToString(); // 或返回其他默认值  
            }
        }
    }
}
